<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>结算</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <!--css文件-->
    <jsp:include page="common/common-css.jsp" />
</head>
<body>

<jsp:include page="common/common-mobileButton.jsp" />

<div class="main-wrapper">
    <!--页面导航栏组件-->
    <jsp:include page="common/common-header.jsp" />

    <main class="main-content">
        <div class="checkout-area section-space-y-axis-100">
            <div class="container">


                <div align="center">
                    <div class="alert alert-success" style="text-align: center; width: 280px;margin-right: 14px;">
                        付款账号: drldmr9964@sandbox.com
                        <br />
                        支付密码: 111111
                    </div>
                </div>

                <form action="/bookmall/order/prepay/" method="post">
                    <div class="row">
                        <div class="col-lg-6 col-12">

                            <div class="checkbox-form">
                                <h3>收货信息</h3>
                                <div class="row">
                                    <div class="col-md-12">
                                        <div class="checkout-form-list">
                                            <label>收货人<span class="required">*</span></label>
                                            <input name="name" value="${usered.realName}" readonly="readonly"
                                                   class="form-control">
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <div class="checkout-form-list">
                                            <label>联系电话<span class="required">*</span></label>
                                            <input name="phone" value="${usered.phone}" readonly="readonly"
                                                   class="form-control">
                                        </div>
                                    </div>

                                    <div class="col-md-12">
                                        <div class="checkout-form-list">
                                            <label>联系电话<span class="required">*</span></label>
                                            <input name="address" value="${usered.address}" readonly="readonly"
                                                   class="form-control">
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <input type="hidden" name="orderId" value="${payOrder.id}">
                        <input type="hidden" name="total" value="${payOrder.total}">

                        <div class="col-lg-6 col-12">
                            <div class="your-order">
                                <h3>订单信息</h3>
                                <table class="table" style="text-align: center">
                                    <tr>
                                        <th>数量</th>
                                        <th>商品</th>
                                        <th>金额</th>
                                    </tr>

                                    <c:forEach items="${order.itemMap}" var="item">
                                        <tr>
                                            <td>${item.value.amount}</td>
                                            <td>${item.value.book.name}</td>
                                            <td>¥
                                                <fmt:formatNumber type="number"
                                                                  value="${(item.value.amount * item.value.price)}"
                                                                  pattern="#.00" />
                                            </td>
                                        </tr>
                                    </c:forEach>
                                </table>

                                <br>
                                <strong>
                                    <span class="amount" style="color: #abd373">总金额: ¥${payOrder.total}</span>
                                </strong>


                                <div class="payment-method">
                                    <div class="payment-accordion">
                                        <div id="accordion">
                                            <div class="card">
                                                <div id="collapseOne" class="collapse show" data-bs-parent="#accordion">
                                                    <div class="card-body">
                                                        <input type="radio" name="paytype" value="1" checked="checked" />支付宝支付
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="order-button-payment"><input value="提交订单" type="submit">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
        </div>

    </main>
    <!--页尾-->
    <jsp:include page="footer.jsp" />
</div>

<!--js文件-->
<jsp:include page="common/common-js.jsp" />
</body>
</html>
